package com.hq.fxh.No0_ChengQu.Activity;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.hq.fxh.No1_Infromation.Video.Adapter.Adapter_List_VideoDetail;
import com.hq.fxh.R;
import com.hq.fxh.Utils.ClickUtils;


public class CommentDetailsActivity extends BaseActivity implements View.OnClickListener {

    protected LinearLayout layoutCommentBack;
    protected ImageView imageDetailIcon;
    protected TextView tvCommentDetailName;
    protected LinearLayout tvCommentDetailZan;
    protected TextView tvCommentDetailHuiFu;
    protected TextView tvCommentDetailCommentContent;
    protected TextView tvCommentDetailCommenTime;
    protected TextView textView;
    protected ListView listComment;
    protected TextView imageNewsDetailsWrite;
    protected LinearLayout imageNewsDetailsComment;
    protected LinearLayout imageNewsDetailsShouChang;
    protected LinearLayout imageNewsDetailsShare;
    protected ImageView imageZan;
    protected TextView tvZan;
    boolean isZhan=false;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_comment_details;
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.layout_Comment_Back) {
            finish();

        } else if (view.getId() == R.id.layout_Zan) {
            isZhan=  ClickUtils.clickZhan(this,imageZan,tvZan,isZhan);

        } else if (view.getId() == R.id.tv_CommentDetail_HuiFu) {

        } else if (view.getId() == R.id.image_NewsDetails_Write) {

        } else if (view.getId() == R.id.image_NewsDetails_Comment) {

        } else if (view.getId() == R.id.image_NewsDetails_ShouChang) {

        } else if (view.getId() == R.id.image_NewsDetails_Share) {

        }
    }

    @Override
    protected void initView() {
        layoutCommentBack = (LinearLayout) findViewById(R.id.layout_Comment_Back);
        layoutCommentBack.setOnClickListener(CommentDetailsActivity.this);
        imageDetailIcon = (ImageView) findViewById(R.id.image_detail_Icon);
        tvCommentDetailName = (TextView) findViewById(R.id.tv_CommentDetail_Name);
        tvCommentDetailZan = (LinearLayout) findViewById(R.id.layout_Zan);
        tvCommentDetailZan.setOnClickListener(CommentDetailsActivity.this);
        tvCommentDetailHuiFu = (TextView) findViewById(R.id.tv_CommentDetail_HuiFu);
        tvCommentDetailHuiFu.setOnClickListener(CommentDetailsActivity.this);
        tvCommentDetailCommentContent = (TextView) findViewById(R.id.tv_CommentDetail_CommentContent);
        tvCommentDetailCommenTime = (TextView) findViewById(R.id.tv_CommentDetail_CommenTime);
        textView = (TextView) findViewById(R.id.textView);
        listComment = (ListView) findViewById(R.id.list_Comment);
        imageNewsDetailsWrite = (TextView) findViewById(R.id.image_NewsDetails_Write);
        imageNewsDetailsWrite.setOnClickListener(CommentDetailsActivity.this);
        imageNewsDetailsComment = (LinearLayout) findViewById(R.id.image_NewsDetails_Comment);
        imageNewsDetailsComment.setOnClickListener(CommentDetailsActivity.this);
        imageNewsDetailsShouChang = (LinearLayout) findViewById(R.id.image_NewsDetails_ShouChang);
        imageNewsDetailsShouChang.setOnClickListener(CommentDetailsActivity.this);
        imageNewsDetailsShare = (LinearLayout) findViewById(R.id.image_NewsDetails_Share);
        imageNewsDetailsShare.setOnClickListener(CommentDetailsActivity.this);
        imageZan = (ImageView) findViewById(R.id.image_Zan);
        tvZan = (TextView) findViewById(R.id.tv_Zan);
    }

    @Override
    protected void initData() {
        listComment.addHeaderView(LayoutInflater.from(this).inflate(R.layout.head_comment_alltext, null));
        listComment.setAdapter(new Adapter_List_VideoDetail(false, new Adapter_List_VideoDetail.CommentCallBack() {
            @Override
            public void call(int positon) {

            }

            @Override
            public void callZhan(int positon, TextView textView, ImageView imageView) {
               isZhan= ClickUtils.clickZhan(CommentDetailsActivity.this,imageView,textView,isZhan);
            }


            @Override
            public void callHuiFu(int positon) {

            }
        }));

    }
}
